<template>
	<view>
		<view>
			<view v-for="(item,index) in appointList" :key="item.id" class="margin">
				<view class="rowsb padding bg-white solid-bottom ">
					<view>约车时间</view>
					<view>{{item.yy_time.split(" ")[0]}}</view>
				</view>
				<view class="rowsb padding bg-white solid-bottom">
					<view>会员名称</view>
					<view>{{item.username}}</view>
				</view>
				<view class="rowsb padding bg-white solid-bottom">
					<view>会员电话</view>
					<view>{{item.userphone}}</view>
				</view>
				<view class="rowsb padding bg-white solid-bottom">
					<view>教练名称</view>
					<view>{{item.p_user}}</view>
				</view>
				<view class="bg-white padding justify-end">
					<view class=" padding-xs" style="border: 1rpx solid #D5D5D5;" @click="gotoeValuate(item)" v-if="item.pid !=null">
						去评价
					</view>
				</view>
			</view>
		</view>
		<view v-if="appointList==''" class="text-center padding text-gray">
			暂无更多内容
		</view>
	</view>
</template>

<script>
	const app = getApp().globalData
	import {
		coach_list
	} from '../../common/path.js'
	export default {
		data() {
			return {
				appointList: []
			}
		},
		onShow() {
			this.appointMen(app.userInfo.id)
		},
		methods: {
			appointMen(id) {
				let data = {
					uid: id
				}
				this.$axios.axios('POST', coach_list, data)
					.then(res => {
						console.log("获取到的", res.data);

						if (res.status == 1) {
							this.appointList = res.data
						}
					})
			},
			//详情
			gotoeValuate(item){
				console.log(item)
				uni.navigateTo({
					url:'../record/gotoeValuate?id='+item.id +'&pid=' +item.pid
				})
			}
		},
		

	}
</script>

<style>
	.message {
		margin: 0 20upx 20upx 20upx;
		background-color: #FFFFFF;
		border-radius: 10upx;
		height: 144upx;
	}

	.message_img {
		height: 96upx;
		width: 96upx;
		margin: 25upx 25upx 0 25upx;
	}

	.its {
		width: 550upx;
	}

	/* .it{width: 550upx;} */
	.text1 {
		font-size: 30upx;
		font-weight: bold;
		margin-top: 25upx;
	}

	.text2 {
		font-size: 23upx;
		color: #CCCCCC;
		margin-top: 25upx;
	}

	.text3 {
		font-size: 26upx;
		color: #999999;
		margin-top: 10upx;
	}
</style>
